Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems Give qualifications of instructors:

Similar presentations


Presentation on theme: "Number Systems Give qualifications of instructors:"— Presentation transcript:

1 Number Systems www.educlash.com Give qualifications of instructors:
DAP teaching computer architecture at Berkeley since 1977 Co-athor of textbook used in class Best known for being one of pioneers of RISC currently author of article on future of microprocessors in SciAm Sept 1995 RY took 152 as student, TAed 152,instructor in 152 undergrad and grad work at Berkeley joined NextGen to design fact 80x86 microprocessors one of architects of UltraSPARC fastest SPARC mper shipping this Fall

2 Overview The design of computers Digital systems
It all starts with numbers Building circuits Building computing machines Digital systems Understanding decimal numbers Binary and octal numbers The basis of computers! Conversion between different number systems credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

3 Digital Computer Systems
Digital systems consider discrete amounts of data. 26 letters in the alphabet 10 decimal digits Larger quantities can be built from discrete values: Words made of letters Numbers made of decimal digits (e.g ) Computers operate on binary values (0 and 1) Easy to represent binary values electrically Voltages and currents. Can be implemented using circuits Create the building blocks of modern computers credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

4 Understanding Decimal Numbers
Decimal numbers are made of decimal digits: (0,1,2,3,4,5,6,7,8,9) But how many items does a decimal number represent? 8653 = 8x x x x100 What about fractions? = 9x x x x x x x10-2 In formal notation -> ( )10 Why do we use 10 digits, anyway? credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

5 Understanding Octal Numbers
Octal numbers are made of octal digits: (0,1,2,3,4,5,6,7) How many items does an octal number represent? (4536)8 = 4x83 + 5x82 + 3x81 + 6x80 = (1362)10 What about fractions? (465.27)8 = 4x82 + 6x81 + 5x80 + 2x x8-2 Octal numbers don’t use digits 8 or 9 credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

6 Understanding Binary Numbers
Binary numbers are made of binary digits (bits): 0 and 1 How many items does an binary number represent? (1011)2 = 1x23 + 0x22 + 1x21 + 1x20 = (11)10 What about fractions? (110.10)2 = 1x22 + 1x21 + 0x20 + 1x x2-2 Groups of eight bits are called a byte ( ) 2 Groups of four bits are called a nibble. (1101) 2 credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

7 Why Use Binary Numbers? Easy to represent 0 and 1 using electrical values. Possible to tolerate noise. Easy to transmit data Easy to build binary circuits. AND Gate 1

8 Conversion Between Number Bases
Octal(base 8) Decimal(base 10) Binary(base 2) Hexadecimal (base16)

9 Convert an Integer from Decimal to Another Base
For each digit position: Divide decimal number by the base (e.g. 2) The remainder is the lowest-order digit Repeat first two steps until no divisor remains. Example for (13)10: Integer Quotient Remainder Coefficient 13/2 = a0 = 1 6/2 = a1 = 0 3/2 = a2 = 1 1/2 = a3 = 1 Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2

10 Convert a Fraction from Decimal to Another Base
For each digit position: Multiply decimal number by the base (e.g. 2) The integer is the highest-order digit Repeat first two steps until fraction becomes zero. Example for (0.625)10: Integer Fraction Coefficient 0.625 x 2 = a-1 = 1 0.250 x 2 = a-2 = 0 0.500 x 2 = a-3 = 1 Answer (0.625)10 = (0.a-1 a-2 a-3 )2 = (0.101)2

11 Binary Addition 1 1 1 1 1 1 carries 1 1 1 1 0 1 + 1 0 1 1 1
Binary addition is very simple. This is best shown in an example of adding two binary numbers… 1 1 1 1 1 1 carries Design state of art organization in 1990 1 1 1

12 Binary Subtraction 1 10 borrows 0 10 10 0 0 10 1 0 0 1 1 0 1
We can also perform subtraction (with borrows in place of carries). Let’s subtract (10111)2 from ( )2… borrows Design state of art organization in 1990

13 Binary Multiplication
Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler… X Design state of art organization in 1990

14 Convert an Integer from Decimal to Octal
For each digit position: Divide decimal number by the base (8) The remainder is the lowest-order digit Repeat first two steps until no divisor remains. Example for (175)10: Integer Quotient Remainder Coefficient 175/8 = / a0 = 7 21/8 = / a1 = 5 2/8 = / a2 = 2 Answer (175)10 = (a2 a1 a0)2 = (257)8

15 Convert an Fraction from Decimal to Octal
For each digit position: Multiply decimal number by the base (e.g. 8) The integer is the highest-order digit Repeat first two steps until fraction becomes zero. Example for (0.3125)10: Integer Fraction Coefficient x 8 = a-1 = 2 x 8 = a-2 = 4 Answer (0.3125)10 = (0.24)8

16 Understanding Hexadecimal Numbers
Hexadecimal numbers are made of 16 digits: (0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F) How many items does an hex number represent? (3A9F)16 = 3x x x x160 = What about fractions? (2D3.5)16 = 2x x x x16-1 = Note that each hexadecimal digit can be represented with four bits. (1110) 2 = (E)16 Groups of four bits are called a nibble. (1110) 2 credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

17 Putting It All Together
Binary, octal, and hexadecimal similar Easy to build circuits to operate on these representations Possible to convert between the three formats

18 Converting Between Base 16 and Base 2
3A9F16 = 3 A 9 F Conversion is easy! Determine 4-bit value for each hex digit Note that there are 24 = 16 different values of four bits Easier to read and write in hexadecimal. Representations are equivalent!

19 Converting Between Base 16 and Base 8
3A9F16 = 3 A 9 F = 3 5 2 3 7 Convert from Base 16 to Base 2 Regroup bits into groups of three starting from right Ignore leading zeros Each group of three bits forms an octal digit.

20 How To Represent Signed Numbers
Plus and minus sign used for decimal numbers: (or +25), -16, etc. For computers, desirable to represent everything as bits. Three types of signed binary number representations: signed magnitude, 1’s complement, 2’s complement. In each case: left-most bit indicates sign: positive (0) or negative (1). Consider signed magnitude: = 1210 Sign bit Magnitude = Sign bit Magnitude

21 One’s Complement Representation
The one’s complement of a binary number involves inverting all bits. 1’s comp of is 1’s comp of is For an n bit number N the 1’s complement is (2n- 1) – N.). To find negative of 1’s complement number take the 1’s complement. = 1210 Sign bit Magnitude = Sign bit Magnitude

22 Two’s Complement Representation
The two’s complement of a binary number involves inverting all bits and adding 1. 2’s comp of is 2’s comp of is For an n bit number N the 2’s complement is (2n-1) – N + 1. To find negative of 2’s complement number take the 2’s complement. = 1210 Sign bit Magnitude = Sign bit Magnitude

23 Two’s Complement Shortcuts
Algorithm 1 – Simply complement each bit and then add 1 to the result. Finding the 2’s complement of ( )2 and of its 2’s complement… N = [N] = Algorithm 2 – Starting with the least significant bit, copy all of the bits up to and including the first 1 bit and then complementing the remaining bits. N = [N] =


Download ppt "Number Systems Give qualifications of instructors:"

Similar presentations


Ads by Google